/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dat;

import com.casestudy1.main.MainMidlet;
import com.casestudy1.view.View;
import com.sun.lwuit.*;
import com.sun.lwuit.animations.CommonTransitions;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.layouts.BoxLayout;
import com.sun.lwuit.util.Resources;
import java.io.IOException;

/**
 *
 * @author My PC
 */
public class lichchieuphim extends View {

    Command cmBack, cmExit;

    public lichchieuphim(final MainMidlet midlet) {
        super(midlet);
        Resources res = null;
        try {
            res = Resources.open("/mytheme.res");//open resource  

        } catch (IOException e) {
        }

        setLayout(new BoxLayout(BoxLayout.Y_AXIS));
        setTitle("Lịch chiếu phim");

        setTransitionOutAnimator(CommonTransitions.createSlide(CommonTransitions.SLIDE_VERTICAL, false, 1000));

        Container con1 = new Container();
        Container con1_1 = new Container();
        con1.setLayout(new BoxLayout(BoxLayout.X_AXIS));
        con1_1.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
        Label l1 = new Label(res.getImage("Image1"));
        con1.addComponent(l1);
        Label l1_1 = new Label("Thời lượng : 90 phút");
        Label l1_2 = new Label("Thể loại : Hành động");
        Label l1_3 = new Label("Diễn viên : Jason Statham, Jennifer Lopez...");
        Label l1_4 = new Label("Đạo diễn : Taylor Hackford");
        Label l1_5 = new Label("Giờ chiếu : 9h, 11h, 13h, 15h, 17h, 19h");
        con1_1.addComponent(l1_1);
        con1_1.addComponent(l1_2);
        con1_1.addComponent(l1_3);
        con1_1.addComponent(l1_4);
        con1_1.addComponent(l1_5);
        con1.addComponent(con1_1);
        con1.setScrollable(true);

        Container con2 = new Container();
        Container con2_1 = new Container();
        con2.setLayout(new BoxLayout(BoxLayout.X_AXIS));
        con2_1.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
        Label l2 = new Label(res.getImage("Image2"));
        con2.addComponent(l2);
        Label l2_1 = new Label("Thời lượng : 100 phút");
        Label l2_2 = new Label("Thể loại : Hành động");
        Label l2_3 = new Label("Diễn viên : Jackie Chan, Oliver Plat, Emilie Guillot...");
        Label l2_4 = new Label("Đạo diễn : Jackie Chan");
        Label l2_5 = new Label("Giờ chiếu : 10h, 12h, 14h, 16h, 18h, 20h");
        con2_1.addComponent(l2_1);
        con2_1.addComponent(l2_2);
        con2_1.addComponent(l2_3);
        con2_1.addComponent(l2_4);
        con2_1.addComponent(l2_5);
        con2.addComponent(con2_1);
        con2.setScrollable(true);

        Container con3 = new Container();
        Container con3_1 = new Container();
        con3.setLayout(new BoxLayout(BoxLayout.X_AXIS));
        con3_1.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
        Label l3 = new Label(res.getImage("Image3"));
        con3.addComponent(l3);
        Label l3_1 = new Label("Thời lượng : 128 phút");
        Label l3_2 = new Label("Thể loại : Hài, Tâm lý, tình cảm");
        Label l3_3 = new Label("Diễn viên : Park Ha-seon, Yoon Sang-hyeon, Park Cheol-min...");
        Label l3_4 = new Label("Đạo diễn : Kim Jin-yeong");
        Label l3_5 = new Label("Giờ chiếu : 10h, 12h, 14h, 16h, 18h, 20h");
        con3_1.addComponent(l3_1);
        con3_1.addComponent(l3_2);
        con3_1.addComponent(l3_3);
        con3_1.addComponent(l3_4);
        con3_1.addComponent(l3_5);
        con3.addComponent(con3_1);
        con3.setScrollable(true);

        cmExit = new Command("Thoát") {
            public void actionPerformed(ActionEvent evt) {
                Display.getInstance().exitApplication();
            }
        };

        cmBack = new Command("Quay lại") {
            public void actionPerformed(ActionEvent evt) {

                midlet.showRCPForm();
            }
        };

        addComponent(con1);
        addComponent(new Label(res.getImage("Image4")));
        addComponent(con2);
        addComponent(new Label(res.getImage("Image4")));
        addComponent(con3);
        addComponent(new Label(res.getImage("Image4")));
        setBackCommand(cmBack);
        addCommand(cmBack);
        addCommand(cmExit);
    }
}
